<div class="col-sm-12">
    <div class="box clearfix">
        <div class="bottom12">
            <ul class="nopadding-left border-bottom">
                <li class="pull-left margin-right30 {{unless  inLeaving " jujia-select-bottom-border"}}" {{action "changeTab" false on="click"}} >
                    <a href="#tab_1_1" data-toggle="tab" class="{{if inLeaving 'noselect-title'  'jujia-select-title' }} the-a">请假申请管理</a>
                </li>
                <li class="pull-left margin-right30  {{if inLeaving " jujia-select-bottom-border"}}" {{action "changeTab" true on="click"}}>
                    <a href="#tab_1_2" data-toggle="tab" class="{{if inLeaving 'jujia-select-title'  'noselect-title' }} the-a">当前请假员工</a>
                </li>
            </ul>
            <div class="clear"></div>
        </div>
        <div class="box nopadding-left nopadding-right">
          <div class="box-body">
            <div id="datatable1_wrapper" class="dataTables_wrapper form-inline" role="grid">
                  <div class="row">
                      <!--搜索-->
                      <div class="col-sm-4">
                        <div class="pull-left">
                            <div class="input-group bottom8">
                                {{input class="form-control" type="text" placeholder="搜索姓名" value=queryStr enter="search"}}
                                <span class="input-group-btn">
                                      <button class="btn btn-primary btn-reduce" type="button" style="touch-action: manipulation; -ms-touch-action: manipulation;"
                                       {{action "search" on="click"}}>
                                        <i class="fa fa-search"></i>
                                      </button>
                                </span>
                            </div>
                        </div>
                      </div>
                      <div class="col-sm-5 nopadding-right nopadding-left">
                           {{callbusi/time-search class="inline-block" text='按请假日期搜索' dateShow=dateShow chooseDate=chooseDate search="search"
                               submmit="submmit" emptied='emptied' changeBeginDateAction='changeBeginDateAction'
                               changeEndDateAction='changeEndDateAction'}}
                       </div>
                      <!--搜索-->
                      <div class="user-add-btn col-sm-3 pull-right nopadding-right">
                          {{#ui/mix-button class=" user-btn pull-right" iconClass="fa-plus" text='新增请假申请' clickAction="toDetailPage"
                           toDetailPage="toDetailPage" }}
                          {{/ui/mix-button}}
                      </div>
                  </div>
                  <table id="datatable1" cellpadding="0" cellspacing="0" border="0"  class="datatable table table-bordered table-hover dataTable"
                         aria-describedby="datatable1_info">
                    <thead>
                      <tr role="row">
                        <th rowspan="1" colspan="1" width="">员工</th>
                        <th rowspan="1" colspan="1" width="">请假类型</th>
                        <th rowspan="1" colspan="1" width="">申请日期</th>
                        <th rowspan="1" colspan="1" width="">请假日期</th>
                        <th rowspan="1" colspan="1" width="">预计销假日期</th>
                        <th rowspan="1" colspan="1" width="">实际销假日期</th>
                        <th rowspan="1" colspan="1" width="">状态</th>
                        {{#unless inLeaving}}
                            <th rowspan="1" colspan="1" width="">操作</th>
                        {{/unless}}
                      </tr>
                    </thead>
                    <tbody role="alert" aria-live="polite" aria-relevant="all" class="">
                      {{#each leaveList as |leave|}}
                      <tr >
                        <td class="ellipsis" {{action "toDetailPage" leave on="click"}}>{{leave.applicant.name}}</td>
                        <td class="ellipsis" {{action "toDetailPage" leave on="click"}}>{{leave.type.typename}}</td>
                        <td class="ellipsis" {{action "toDetailPage" leave on="click"}}>{{leave.applyTimeStr}}</td>
                        <td class="ellipsis" {{action "toDetailPage" leave on="click"}}>{{leave.expectStartTimeStr}}</td>
                        <td class="ellipsis" {{action "toDetailPage" leave on="click"}}>
                              {{leave.expectEndTimeStr}}
                        </td>
                        <td class="ellipsis" {{action "toDetailPage" leave on="click"}}>
                              {{leave.realEndTimeStr}}
                        </td>
                        <td class="ellipsis" {{action "toDetailPage" leave on="click"}}>{{leave.statusStr}}</td>
                        {{#unless inLeaving}}
                          <td class="ellipsis">
                              {{# if   (eq  leave.flowStatus 0)}}
                                    <a {{action "deleteLeave" leave}}>删除</a>
                                    <a {{action "approvalLeave" leave}}>审批</a>
                              {{/if}}
                              {{# if   (eq  leave.flowStatus 1)}}
                                    <a {{action "completeLeave" leave}}>销假</a>
                              {{/if}}
                              {{# if   (eq  leave.flowStatus 2)}}
                                    <a {{action "deleteLeave" leave}}>删除</a>
                              {{/if}}
                          </td>
                        {{/unless}}
                      </tr>
                      {{/each}}
                    </tbody>
                  </table>
                  {{#if leaveList }}
                      {{page-numbers content=leaveList showFL=true numPagesToShow=10 }}
                  {{else}}
                          <h1 class="col-sm-12 center unTask"></h1>
                  {{/if}}
            </div>
         </div>
        </div>
    </div>
</div>
<!-- 销假 -->
{{#if showComplete}}
    {{#bs-modal body=false footer=false header=false closedAction=(action "cancelCompleteLive")}}
        {{#bs-modal-body}}
                <div class="col-sm-12 nopadding-left">
                    <div class="form-input-group">
                        <span class="input-group-addon">请假结束日期:</span>
                        {{#bs-form-element class="inline-block form-input-group" controlType="accessType" property="accessType" }}
                            {{ui/addon/bs-datetimepicker date=null placeholder="必填项"
                              locale="zh-CN" iconClasses="fa fa-calendar" format='YYYY-MM-DD'
                                show="doNothing" change="changeEndTime" }}
                        {{/bs-form-element}}
                    </div>
                </div>
        {{/bs-modal-body}}
        {{#bs-modal-footer class="user-add-btn" }}
            {{#ui/mix-button class="user-btn edit-btn" iconClass="fa fa-check" text='确定' clickAction="saveCompleteLive" saveCompleteLive="saveCompleteLive" }}
            {{/ui/mix-button}}
            {{#ui/mix-button class="user-btn times-btn" iconClass="fa fa-mail-reply" text='取消' clickAction="cancelCompleteLive" cancelCompleteLive="cancelCompleteLive" }}
            {{/ui/mix-button}}
        {{/bs-modal-footer}}
    {{/bs-modal}}
{{/if}}
<!--审批-->
{{#if showApproval}}
{{#bs-modal body=false footer=false header=false closedAction=(action "cancelCompleteLive")}}
    {{#bs-modal-body}}
            <div class="col-sm-12 nopadding-left">
                <div class="form-input-group">
                    <span class="input-group-addon">审批意见:</span>
                    {{textarea type="text" class="full-width inline-block form-input-group label-normal form-control" value=approvalLeave.remark}}
                </div>
            </div>
    {{/bs-modal-body}}
    {{#bs-modal-footer class="user-add-btn" }}
        {{#ui/mix-button class="user-btn edit-btn" iconClass="fa fa-check" text='审批通过' clickAction="passApproval" passApproval="passApproval" }}
        {{/ui/mix-button}}
        {{#ui/mix-button class="user-btn times-btn" iconClass="fa fa-times" text='审批不通过' clickAction="noPass" noPass="noPass" }}
        {{/ui/mix-button}}
    {{/bs-modal-footer}}
{{/bs-modal}}
{{/if}}
